package com.haierp.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.haierp.mapper.DeviceMapper;
import com.haierp.model.Device;
import com.haierp.service.IDeviceService;

@Service("deviceService")
public class DeviceServiceImpl extends SuperServiceImpl<DeviceMapper, Device>  implements IDeviceService {

	@Override
	public Device queryDevice(String cookie) {
		EntityWrapper<Device> wrapper = new EntityWrapper<Device>();
		wrapper.where("cookie={0}", cookie);
		List<Device>  devices= this.baseMapper.selectList(wrapper);
		if(devices!=null&&!devices.isEmpty()){
			return devices.get(0);
		}
		return null;
	}
//	@Autowired
//	private DeviceMapper deviceMapper;

	
}
